import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../views/Layout.vue'
import Product from '../views/Product'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: Layout,
    children: [
      {
        path: '',
        name: 'Product',
        component: Product,
        meta: {
          isLogin: true
        }
      },
      {
        path: 'params',
        name: 'Params',
        component: () => import('../views/Params'),
        meta: {
          isLogin: true
        }
      },
      {
        path: 'Content',
        name: 'Content',
        component: () => import('../views/Content/index.vue'),
        meta: {
          isLogin: true
        }
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../views/Login')
  },
  {
    path: '/UCenter',
    name: 'UCenter',
    component: () => import('../views/UCenter'),
    meta: {
      isLogin: true
    }
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
